
#include <iostream>
#include <cstring>
using namespace std;

class Frabjous
{
private:
    char fab[20];
public:
    Frabjous(const char * s="C++"){
        strncpy(fab, s, 19);
        fab[19] = '\0';
    }
    virtual void tell() {cout <<fab;}
};

class Gloam :private Frabjous
{
private:
    int glip;
public:
    Gloam(int g=0, const char * s="C++");
    Gloam(int g, const Frabjous & f);
    void tell();
};

Gloam::Gloam(int g, const char * s):Frabjous(s), glip(g)
{
}

Gloam::Gloam(int g, const Frabjous & f):Frabjous(f), glip(g)
{
}

void Gloam::tell() 
{
    cout << glip << " ";
    static_cast<Frabjous>(*this).tell();
    cout << endl;
}

int main(int argc, char const *argv[])
{
    Frabjous fb("Cpp demo");
    fb.tell();
    cout << endl;

    Gloam g1(6, fb);
    g1.tell();
    Gloam g2(6, "Gloam obj");
    g2.tell();
    return 0;
}
